package com.itheima.app;

import com.itheima.dao.UserDao;
import com.itheima.service.TeacherService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserApp {
    public static void main(String[] args) {
        //1.解析配置文件 获得容器对象
        ApplicationContext userContext = new ClassPathXmlApplicationContext("application-user.xml");
        //2.从容器中获得bean对象
        UserDao userDao = (UserDao)userContext.getBean("userDao");
        //3.使用
        userDao.save();
    }
}
